public class Hall {
    private String name;
    private Seat[][] seats;

    public Hall(String name, int rows, int cols) {
        this.name = name;
        this.seats = new Seat[rows][cols];
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                seats[i][j] = new Seat(i, j);
            }
        }
    }

    public String getName() {
        return name;
    }

    public int getRows() {
        return seats.length;
    }

    public int getCols() {
        return seats[0].length;
    }

    public Seat getSeat(int row, int col) {
        if (row < 0 || row >= getRows() || col < 0 || col >= getCols()) {
            throw new IndexOutOfBoundsException("座位越界");
        }
        return seats[row][col];
    }

    public Seat[][] getSeats() {
        return seats;
    }
} 